<template>
  <!-- 当前账户 -->
  <view class="page">
    <nav-bar
      :navTitle="title"
      iconColor="#000"
      :backgroundColor="backgroundColor"
      :isBackgroundColor="false"
    ></nav-bar>
    <form @submit="onSubmit">
      <!-- 账户名 -->
      <view class="form-item px-38 pt20 bg-white h-98 mt28">
        <label class="tips f-s-32 fw-600">账户名</label>
        <view class="prompt input fw-400 col-balck">{{
          formData.username
        }}</view>
      </view>
      <!-- 账户密码 -->
      <view class="information borRadius-19 bg-white" @click="goToModify">
        <view class="form-item h-98 mx-38">
          <label class="tips f-s-32 fw-600">账户密码</label>
          <view class="flex align-center"
            ><view class="prompt mr10 input fw-400 col-balck">修改</view>
            <image
              src="https://app-cangshu.oss-rg-china-mainland.aliyuncs.com/asssets/merchant/forwardShow.png"
              class="forwardShow"
              mode="scaleToFill"
          /></view>
        </view>
      </view>
      <!-- 已绑定手机号 -->
      <view class="information borRadius-19 bg-white">
        <view class="form-item h-98 mx-38">
          <label class="tips f-s-32 fw-600">已绑定手机号</label>
          <view class="prompt input fw-400 col-balck">{{
            formData.phone
          }}</view>
        </view>
      </view>
      <!-- 安全密码 -->
      <!-- <view class="information borRadius-19 bg-white pb20">
        <view class="form-item h-98 mx-38">
          <label class="tips f-s-32 fw-600">安全密码</label>
          <image
            src="https://app-cangshu.oss-rg-china-mainland.aliyuncs.com/asssets/merchant/forwardShow.png"
            class="forwardShow"
            mode="scaleToFill"
          />
        </view>
      </view> -->
    </form>
    <view class="btnBpx">
      <button
        :loading="loading"
        open-type=""
        class="btn"
        hover-class="button-hover"
        @click="quitLogin"
      >
        {{ "退出登录" }}
      </button></view
    >
  </view>
</template>

<script>
import navBar from "@/components/navBar";
import { getUserInfoData } from "@/api/user.js";
export default {
  components: {
    navBar,
  },
  data() {
    return {
      title: "当前账户",
      backgroundColor: "#fff",
      loading: false,
      status: false, // 是否已经实名
      formData: {
        username: "",
        phone: "",
        nickname: "",
      },
    };
  },
  onLoad(options) {},
  mounted() {
    this.getUserInfo();
  },
  methods: {
    // 退出登录
    quitLogin() {},
    // 初始化商户信息
    getUserInfo() {
      getUserInfoData().then((res) => {
        let { username, phone, nickname } = res.data.sysUser;
        this.formData.username = username;
        this.formData.phone = phone;
        this.formData.nickname = nickname;
      });
    },
    goToModify() {
      uni.navigateTo({
        url: `/pages/myInfo/modifyPassword/index?name=${this.formData.nickname}&phone=${this.formData.phone}`,
      });
    },
  },
};
</script>

<style scoped lang="scss">
.form-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  //   margin-bottom: 20px;
}
.mt-24 {
  margin-top: 24rpx;
}
.h-98 {
  height: 98rpx;
}
.px-38 {
  padding: 0rpx 38rpx;
}
.mx-38 {
  margin: 0rpx 38rpx;
}
.prompt {
  width: 450rpx;
  font-size: 32rpx;
  color: #b2aeae;
}
.col-balck {
  color: #000 !important;
}

.input {
  text-align: right;
}
.pt20 {
  padding-top: 20rpx;
}
.pb20 {
  padding-bottom: 20rpx;
}
.forwardShow {
  width: 11rpx;
  height: 20rpx;
}
.mr10 {
  margin-right: 10rpx;
}
.btnBpx {
  position: fixed;
  bottom: 40rpx;
  width: 100%;
}
.btn {
  margin: 0rpx 31rpx;
  height: 96rpx;
  line-height: 96rpx;
  background: #664fe9;
  border-radius: 14rpx;
  font-size: 31rpx;
  color: #ffffff;
}
</style>
